package cn.itcast.bos.transit.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.base.action.BaseAction;
import cn.itcast.bos.domain.transit.TransitInfo;
import cn.itcast.bos.transit.service.TransitInfoService;

@ParentPackage("json-default")
@Scope("prototype")
@Controller
@Namespace("/")
public class TransitInfoAction extends BaseAction<TransitInfo>{

	@Autowired
	private TransitInfoService transitInfoService; 
	@Action(value="show_transitInfo",results={@Result(type="json",name="success")})
	public String getTransitInfo(){
		Pageable pageable=new PageRequest(page-1, rows);
		Page<TransitInfo> page= transitInfoService.getTransitInfo(pageable);
		putIntoValueStack(page);
		return SUCCESS;
	}
	
	
}
